#region Using

using System;
using XNgine.Misc;

#endregion

namespace XNgine.ScreenManagement
{
    public interface IGameScreen : INamedItem
    {
        #region Properties
        
        #region Blocking Operation

        /// <summary>
        /// Whether or not this screen should block the update of
        /// screens below (for pause menus), etc.
        /// </summary>
        bool BlocksUpdate { get; set; }

        /// <summary>
        /// Whether or not this screen should block the draw of
        /// screens below (for pause menus), etc.
        /// </summary>
        bool BlocksDraw { get; set; }

        /// <summary>
        /// Whether or not this screen should block the input processing of
        /// screens below (for pause menus), etc.
        /// </summary>
        bool BlocksInput { get; set; }

        #endregion

        #region Overriding Block Operation

        /// <summary>
        /// Whether or not this screen will override a blocked update
        /// from an above screen (for a background screen), etc.
        /// </summary>
        bool OverrideUpdateBlocked { get; set; }

        /// <summary>
        /// Whether or not this screen will override a blocked draw
        /// from an above screen (for a background screen), etc.
        /// </summary>
        bool OverrideDrawBlocked { get; set; }

        /// <summary>
        /// Whether or not this screen will override a blocked input
        /// from an above screen (for a background screen), etc.
        /// </summary>
        bool OverrideInputBlocked { get; set; }

        #endregion

        #region Loading and Initialization

        /// <summary>
        /// Whether or not the screen is initialized. Handles firing of
        /// OnInitialized.
        /// </summary>
        bool Initialized { get; set; }
        bool ContentLoaded { get; set; }

        #endregion

        #region Visibility

        bool Visible { get; set; }

        #endregion

        #region Input

        /// <summary>
        /// Whether or not we want to block our own input so we can
        /// do things like loading screens that will want to accept
        /// input at some point, but not at startup
        /// </summary>
        bool InputDisabled { get; set; }

        /// <summary>
        /// Indicates if the screen is allowed to process input
        /// (Updated ad every frame)
        /// </summary>
        bool IsInputAllowed { get; set; }

        #endregion
         
        #endregion

        #region Events

        /// <summary>
        /// Fired when the screen's Initialize() is finished. This can
        /// be hooked for things like asynchronous loading screens
        /// </summary>
        event EventHandler OnInitialized;

        #endregion

        #region Loading and Initialization

        /// <summary>
        /// Overridable function to initialize the GameScreen
        /// (Remember to set the Initialized to true or call base.Initialize();)
        /// </summary>
        void Initialize();

        void LoadContent();
        void UnloadContent();

        #endregion

        #region Main Loop

        /// <summary>
        /// Performs the update of the screen
        /// </summary>
        void Update();

        /// <summary>
        /// Perfroms the drawing of the screen
        /// </summary>
        void Draw();

        #endregion

        #region Core Functionality Methods

        /// <summary>
        /// Closes the GameScreen(removes it from the ScreenManager)
        /// </summary
        void Close();

        void Show();

        #endregion
    }
}